package phase3_testCase;


import java.io.ByteArrayInputStream;
import java.util.Vector;

import phase1.Block;
import phase1.IO;
import phase3.Main;
import junit.framework.TestCase;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;


public class Main_testCase extends TestCase{
	

	public void setUp() { }

	public void tearDown() {}
	

//System test
	public void testMain1() {
		
	    ByteArrayOutputStream outContent = new ByteArrayOutputStream();
		ByteArrayInputStream inContent = new ByteArrayInputStream("src/block4.txt".getBytes());
		System.setOut(new PrintStream(outContent));	
		System.setIn(inContent);
		//Main abc=new Main();
		Main.main(null);	
		String separator=System.getProperty("line.separator");
	
		assertEquals("Please input the file path for the text file: "+separator+"The block that you have inputted:" + separator + "Block A :[a b k]	point to: B " + separator + "Block B :[s n k]	point to: C " + separator + "Block C :[c h m]	point to: D " + separator + "Block D :[d i n]	point to: E " + separator + "Block E :[e r o]	point to: A "+separator+"Please wait..."+separator
				+"After the analysis of system, words have been found out."+separator+
				"------------Words Included------------"
				+separator+"Word 1: as"+separator+
				"Word 2: an"+separator,outContent.toString());
	}


}